<template>
  <div>
      <p @click="toggleDetail(item.name)">{{item.name}}</p>
  </div>
</template>

<script>
import { toRefs ,reactive} from '@vue/reactivity';
import{mapMutations} from 'vuex'
export default {
    props:{
        item:{
            type:Object
        }
    },
    setup(){
        const state = reactive({
            toggleDetail(val){
                console.log(val);
            },
            ...mapMutations(["changeTitle"])
        })
        const refState = toRefs(state)
        return{
            ...refState
        }
    }
}
</script>

<style>

</style>